import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCustomerTypeController } from '../../../controllers';
const uctoocustomerTypeRouter = new Router();
const customerTypeController = new uctooCustomerTypeController();

uctoocustomerTypeRouter.post('/add', requireUser, customerTypeController.add);
uctoocustomerTypeRouter.post('/edit', requireUser, rowLevelPermission('uctoo/customer_type'), customerTypeController.edit);
uctoocustomerTypeRouter.post('/del', requireUser, rowLevelPermission('uctoo/customer_type'), customerTypeController.delete);

//For getting customerType with permission control
uctoocustomerTypeRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/customer_type'), customerTypeController.getSingle);
uctoocustomerTypeRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/customer_type'), customerTypeController.getMany);
uctoocustomerTypeRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/customer_type'), customerTypeController.getMany);

//#endregion AutoCreateCode
export default uctoocustomerTypeRouter;
